import javax.xml.transform.Source;
import java.util.Scanner;

public class Test_demo_string {

    public static void main(String[] args) {

        //输入一个字符串，看看里面有多少个’A’或’a’字符
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输一个字符串");
        String str =scanner.nextLine();
        //System.out.println(str);
        //把字符串转换为字符数组
        char[] chars = str.toCharArray();
        //记录大A
        int countA=0;
        //记录大a
        int counta=0;
        for(int i=0;i<chars.length;i++){
            //System.out.println(chars[i]);
            if(chars[i]=='A'){
                countA++;
            }else if(chars[i]=='a'){
                counta++;
            }
        }

        System.out.println("A="+countA+",a="+counta);

    }

   /* char[i]>=65 && char[i]<=90
    char[i]>=97 && char[i]<=122*/

}
